import React,{useState} from 'react'
import store from '../store'
export default function Left() {
  const [,setVal]=useState({})
  store.subscribe(()=>{
    setVal({})  //主要是为了让页面更新 ，但是实际没有任何意义
  })
  return (
    <div style={{flex:1,height:'100vh',background:'springgreen'}}>
        <div>
          store:{store.getState()}
        </div>
        <div>
          <button onClick={()=>{
            store.dispatch({type:'increment'})
          }}>+</button>
          <button onClick={()=>{
            store.dispatch({type:'sub'})
          }}>-</button>
        </div>
    </div>
  )
}
